package com.ruoyi.project.wf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.wf.mapper.WfActivityLibMapper;
import com.ruoyi.project.wf.domain.WfActivityLib;
import com.ruoyi.project.wf.service.IWfActivityLibService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 流程工作项库Service业务层处理
 *
 * @author XQ.XU
 * @date 2020-03-20
 */
@Service
public class WfActivityLibServiceImpl extends ServiceImpl<WfActivityLibMapper, WfActivityLib> implements IWfActivityLibService
{
    @Autowired
    private WfActivityLibMapper wfActivityLibMapper;

    /**
     * 查询流程工作项库
     *
     * @param id 流程工作项库ID
     * @return 流程工作项库
     */
    @Override
    public WfActivityLib selectWfActivityLibById(String id)
    {
        return wfActivityLibMapper.selectWfActivityLibById(id);
    }

    /**
     * 查询流程工作项库列表
     *
     * @param wfActivityLib 流程工作项库
     * @return 流程工作项库
     */
    @Override
    public List<WfActivityLib> selectWfActivityLibList(WfActivityLib wfActivityLib)
    {
        return wfActivityLibMapper.selectWfActivityLibList(wfActivityLib);
    }

    /**
     * 新增流程工作项库
     *
     * @param wfActivityLib 流程工作项库
     * @return 结果
     */
    @Override
    public int insertWfActivityLib(WfActivityLib wfActivityLib)
    {
        wfActivityLib.setCreateTime(DateUtils.getNowDate());
        return wfActivityLibMapper.insertWfActivityLib(wfActivityLib);
    }

    /**
     * 修改流程工作项库
     *
     * @param wfActivityLib 流程工作项库
     * @return 结果
     */
    @Override
    public int updateWfActivityLib(WfActivityLib wfActivityLib)
    {
        wfActivityLib.setUpdateTime(DateUtils.getNowDate());
        return wfActivityLibMapper.updateWfActivityLib(wfActivityLib);
    }

    /**
     * 删除流程工作项库对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWfActivityLibByIds(String ids)
    {
        return wfActivityLibMapper.deleteWfActivityLibByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除流程工作项库信息
     *
     * @param id 流程工作项库ID
     * @return 结果
     */
    @Override
    public int deleteWfActivityLibById(String id)
    {
        return wfActivityLibMapper.deleteWfActivityLibById(id);
    }
}
